package com.yuan.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class TestExceptionController {


    @GetMapping("/demo01")
    public String demo01(){
        String i = null;
        System.out.println("demo01 controller执行了");

        int length = i.length();
        return "demo01";
    }

    @GetMapping("/demo02")
    public String demo02(){

        System.out.println("demo02 controller执行了");
        int i = 10/0;


        return "demo02";
    }


}
